<!doctype html>
<html class="no-js">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>爱帮诊</title>
    <meta name="description" content="">
    <meta name="keywords" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <link rel="icon" type="image/png" href="__PUBLIC__/assets/i/favicon.png">
    <link rel="stylesheet" href="__PUBLIC__/css/common.css">
    <link rel="stylesheet" href="__PUBLIC__/assets/css/amazeui.min.css">
    <link rel="stylesheet" href="__PUBLIC__/assets/css/app.css">
    <style>
        .yl-table td {
            border: solid 2px #F2F2F2;
        }

        .header-1 {
            background-color: #42AD84;
            color: #fff;
        }

        .dv-w {
            background-color: #fff;
        }

        .am-tabs-d2 .am-tabs-nav > .am-active a {
            font-size: 16px;
            color: #42AD84;
        }

        .am-tabs-d2 .am-tabs-nav a {
            color: #6f6d6d;
            font-size: 16px;
        }

        .am-tabs-d2 .am-tabs-nav > .am-active {
            position: relative;
            background-color: #fff;
            border-bottom: 1px solid #42AD84
        }

        .am-tabs-d2 .am-tabs-nav > .am-active:after {
            position: absolute;
            width: 0;
            height: 0;
            bottom: 0;
            left: 50%;
            margin-left: -5px;
            border: 6px solid transparent;
            content: "";
            z-index: 1;
            /* border-bottom-color: #0e90d2 */
        }
        .input-1 {
            width: 100%;
            border: none;
            padding: 10px 0 10px 10px;
            outline: none
        }
        .a-c{
            color: #fff;
        }
        .yl-hr {
            margin-bottom: 0;
            border: solid #F2F2F2 2rem;
            margin-top: 0;
        }
    </style>
</head>
<body style="background-color: #EFEFEF;">
<!-- Header -->
<header data-am-widget="header" class="am-header am-header-default header-1">
    <div class="am-g">
        <div class="am-u-sm-4"><a href="#" onclick="javascript:history.go(-1);" class="a-c"><</a></div>
        <div class="am-u-sm-4" style="text-align: center;">提交预约</div>
        <div class="am-u-sm-4" style="text-align: right;"></div>
    </div>
</header>

<!--内容列表-->
<div class="dv-w">
    <div class="am-g">
        <div class="am-u-sm-4">
            <p>就诊人：</p>
        </div>
        <div class="am-u-sm-8">
            <input type="text" id="name" class="input-1" placeholder="请输入联系姓名"/>
        </div>
    </div>
    <hr style="margin: 0;"/>
    <div class="am-g">
        <div class="am-u-sm-4">
            <p>孕产需求：</p>
        </div>
        <div class="am-u-sm-8">
            <input type="text" id="ill" class="input-1" placeholder="请输入孕产需求"/>
        </div>
    </div>
    <hr style="margin:0;"/>
    <div class="am-g">
        <textarea placeholder="详细描述您的病情，症状等，以及想要获得的帮助" id="desc" style="width: 100%;height: 10rem;outline: none;border: 0;"></textarea>
    </div>
    <hr style="margin:0;"/>
    <div class="am-g" style="height: 5rem;margin-top: 2rem;">
        <div class="am-u-sm-6">
            <div class="am-form-group am-form-file">
                <button type="button" class="am-btn am-btn-default am-btn-sm">
                    <i class="am-icon-cloud-upload"></i> 选择要上传的文件</button>
                <input type="file" multiple>
            </div>
        </div>
        <div class="am-u-sm-6">
            <p style="font-size: 12px;color: #9a9a9a">病历图片，方便医生确认</p>
        </div>
    </div>
    <hr style="margin:0;"/>
    <div class="am-g">
        <div class="am-u-sm-4">
            <p>问诊人手机：</p>
        </div>
        <div class="am-u-sm-8">
            <input type="text" id="phone" class="input-1" value="{$phone}"/>
        </div>
    </div>
    <hr style="margin:0;"/>
    <div class="am-g">
        <p style="font-size: 12px;color: #9a9a9a;margin-bottom: 0;">请确保手机畅通，以便病情需要时，客服或医生能及时联系您</p>
    </div>
    <hr class="yl-hr"/>
    <div class="am-g">
        <div class="am-form-group">
            <div class="am-u-sm-10">
                <div class="checkbox">
                    <label>
                        <input type="checkbox"><span style="font-size: 13px;color: #9a9a9a;">我已阅读并同意<strong>爱帮诊服务协议</strong></span>
                    </label>
                </div>
            </div>
        </div>
    </div>
    <hr style="margin:0 0 1rem 0;"/>
    <div style="text-align: center;">
        <button type="button" id="mingyuyue" class="am-btn am-btn-default am-radius" style="width: 90%;color: #222;margin-bottom: 1rem;">立即预约</button>
    </div>
</div>
<!--end-->

<script src="__PUBLIC__/assets/js/jquery.min.js"></script>
<script src="__PUBLIC__/assets/js/amazeui.min.js"></script>
<script src="__PUBLIC__/js/alertPopShow.js"></script>
<script>
    //预约
    var userReg = function () {
        //判断手机号
        var name = $('#name').val();
        if(name.length == 0){
            alert("请输入就诊人名字");
            return false;
        }
        var ill = $('#ill').val();
        if(ill.length == 0){
            alert("请输入孕产需求");
            return false;
        }

        var desc = $("#desc").val();
        var phone = $("#phone").val();
        if(phone.length == 0){
            alert("请输入手机号");
            return false;
        }

        $.ajax({
            url:"{:U('Index/mingyuyue2')}",
            type:"post",
            data:{name:name,ill:ill,desc:desc,phone:phone},
            dataType:"json",
            success:function (res) {
                if(res.code != 0){
                    popTipShow.alert('预约失败','系统正忙，请您重新预约', ['知道了'],
                        function(e){
                            //callback 处理按钮事件
                            var button = $(e.target).attr('class');
                            if(button == 'ok'){
                                //按下确定按钮执行的操作
                                this.hide();
                            }
                        }
                    );
                    return false;
                }

                popTipShow.alert('预约成功','感谢您的预约，稍后会有客服联系您', ['知道了'],
                    function(e){
                        //callback 处理按钮事件
                        var button = $(e.target).attr('class');
                        if(button == 'ok'){
                            //按下确定按钮执行的操作
                            this.hide();
                            window.location.href="{:U('Index/index')}";
                        }
                    }
                );
                return false;
            }
        })
    }
    $('#mingyuyue').click(userReg);
</script>
</body>
</html>
